InĀ [1]:
from pathlib import Path
from compare import ReferenceComparer, get_last_two_commits

Find commits to compare¶

By default, the notebook compares last two commits(ref1hash is the older one and ref2hash is the newer one). You can customise this by changing the ref1_hash and ref2_hash variables or by providing REF1_HASH and REF2_HASH commit values. You can also provide custom spectrum paths for the two hashes with respect to the root directory for that commit.

InĀ [2]:
import os

ref1_hash = os.getenv('REF1_HASH')
ref2_hash = os.getenv('REF2_HASH')

if not (ref1_hash and ref2_hash):
    ref1_hash, ref2_hash = get_last_two_commits()

if not (ref1_hash and ref2_hash):
    raise ValueError("Could not get commit hashes.")
    

if os.getenv('CUSTOM_REF1_SPECTRUM_PATH'):
    custom_ref1_spectrum_path = os.getenv('CUSTOM_REF1_SPECTRUM_PATH')
else:
    custom_ref1_spectrum_path = 'tardis/spectrum/tests/test_spectrum_solver/test_spectrum_solver/TestSpectrumSolver.h5'

if os.getenv('CUSTOM_REF2_SPECTRUM_PATH'):
    custom_ref2_spectrum_path = os.getenv('CUSTOM_REF2_SPECTRUM_PATH')
else:
    custom_ref2_spectrum_path = 'tardis/spectrum/tests/test_spectrum_solver/test_spectrum_solver/TestSpectrumSolver.h5'
InĀ [3]:
ref1_hash, ref2_hash
Out[3]:
('b2fdf418ac1a3631f8c3d2a5f392b6ebfa09ba0b',
 'c31d35a1ad0f9b74f4bde010d4ad9c9a4f086fa5')

Example Values¶

Below are example values you can test the notebook with.

InĀ [4]:
# ref1_hash="170f1a2c0d8c6db518a4b9a0f4cb9b657aaa61b6"
# ref2_hash="d9fd3bb659d185bd9ece10b8e2175cf497ea84c5"
# custom_ref1_spectrum_path = 'tardis/spectrum/tests/test_spectrum_solver/test_spectrum_solver/TestSpectrumSolver.h5'
# custom_ref2_spectrum_path = 'test_spectrum_solver/test_spectrum_solver/TestSpectrumSolver.h5'

Initialise the ReferenceComparer class¶

InĀ [5]:
comparer = ReferenceComparer(ref1_hash=ref1_hash, ref2_hash=ref2_hash, print_path=True)

comparer.setup()
comparer.diff_analyzer.display_diff_tree(comparer.dcmp)
Created temporary directory at /tmp/ref_compare_lfl0odub
ā”œ .github/
│ ā”œ actions/
│ │ ā”œ setup_env/
│ ā”œ workflows/
ā”œ arepo_data/
ā”œ atom_data/
│ ā”œ nlte_atom_data/
│ ā”œ stardis_atom_data/
ā”œ tardis/
│ ā”œ opacities/
│ │ ā”œ tests/
│ │ │ ā”œ test_tau_sobolev/
│ │ │ │ ✱ test_calculate_sobolev_line_opacity.h5
│ ā”œ plasma/
│ │ ā”œ equilibrium/
│ │ │ ā”œ tests/
│ │ │ │ ā”œ test_level_populations/
│ │ │ │ │ ā”œ test_level_population_solver/
│ │ │ │ │ │ ✱ test_solve__collisional_rate_solver0-radiative_transitions0__.h5
│ │ │ │ ā”œ test_rate_matrix/
│ │ │ │ │ ✱ test_rate_matrix_solver__collisional_rate_solver0-radiative_transitions0__.h5
│ │ ā”œ tests/
│ │ │ ā”œ test_complete_plasmas/
│ │ │ │ ā”œ test_plasma/
│ │ │ │ │ ✱ plasma_unittest_disable_electron_scattering_False.h5
│ │ │ │ │ ✱ plasma_unittest_disable_electron_scattering_True.h5
│ │ │ │ │ ✱ plasma_unittest_excitation_dilute-lte.h5
│ │ │ │ │ ✱ plasma_unittest_excitation_lte.h5
│ │ │ │ │ ✱ plasma_unittest_helium_treatment_recomb-nlte.h5
│ │ │ │ │ ✱ plasma_unittest_helium_treatment_recomb-nlte_delta_treatment_0.5.h5
│ │ │ │ │ ✱ plasma_unittest_initial_t_inner_10000 K.h5
│ │ │ │ │ ✱ plasma_unittest_initial_t_rad_10000 K.h5
│ │ │ │ │ ✱ plasma_unittest_ionization_lte.h5
│ │ │ │ │ ✱ plasma_unittest_ionization_nebular.h5
│ │ │ │ │ ✱ plasma_unittest_line_interaction_type_downbranch.h5
│ │ │ │ │ ✱ plasma_unittest_line_interaction_type_macroatom.h5
│ │ │ │ │ ✱ plasma_unittest_line_interaction_type_scatter.h5
│ │ │ │ │ ✱ plasma_unittest_nlte.h5
│ │ │ │ │ ✱ plasma_unittest_nlte_classical_nebular.h5
│ │ │ │ │ ✱ plasma_unittest_nlte_coronal_approximation.h5
│ │ │ │ │ ✱ plasma_unittest_radiative_rates_type_blackbody.h5
│ │ │ │ │ ✱ plasma_unittest_radiative_rates_type_detailed.h5
│ │ │ │ │ ✱ plasma_unittest_radiative_rates_type_detailed_w_epsilon_1e-10.h5
│ │ │ │ │ ✱ plasma_unittest_radiative_rates_type_dilute-blackbody.h5
│ │ │ ā”œ test_hdf_plasma/
│ │ │ │ ✱ test_hdf_levels.h5
│ │ │ ā”œ test_nlte_excitation/
│ │ │ ā”œ test_nlte_solver/
│ │ │ ā”œ test_plasma_continuum/
│ │ │ ā”œ test_tardis_model_density_config/
│ │ │ │ ✱ test_isotope_number_densities.h5
│ ā”œ simulation/
│ │ ā”œ tests/
│ │ │ ā”œ test_simulation/
│ │ │ │ ✱ test_plasma_estimates__dilution_factor__.h5
│ │ │ │ ✱ test_plasma_estimates__j_estimator__.h5
│ │ │ │ ✱ test_plasma_estimates__nu_bar_estimator__.h5
│ │ │ │ ✱ test_plasma_estimates__output_energies__.h5
│ │ │ │ ✱ test_plasma_estimates__output_nus__.h5
│ │ │ │ ✱ test_plasma_estimates__t_radiative__.h5
│ │ │ │ ✱ test_plasma_state_iterations__iterations_electron_densities__.h5
│ │ │ │ ✱ test_plasma_state_iterations__iterations_t_inner__.h5
│ │ │ │ ✱ test_plasma_state_iterations__iterations_t_rad__.h5
│ │ │ │ ✱ test_plasma_state_iterations__iterations_w__.h5
│ ā”œ spectrum/
│ │ ā”œ tests/
│ │ │ ā”œ test_spectrum_solver/
│ │ │ │ ā”œ test_spectrum_solver/
│ │ │ │ │ ✱ TestSpectrumSolver.h5
│ ā”œ tests/
│ │ ā”œ test_tardis_full/
│ │ │ ā”œ test_transport_simple/
│ │ │ │ ✱ TestTransportSimple.h5
│ │ ā”œ test_tardis_full_formal_integral/
│ │ │ ā”œ test_transport_simple_formal_integral/
│ │ │ │ ✱ test_simulation__-1-downbranch__.h5
│ │ │ │ ✱ test_simulation__-1-macroatom__.h5
│ │ │ │ ✱ test_simulation__30-downbranch__.h5
│ │ │ │ ✱ test_simulation__30-macroatom__.h5
│ │ │ │ ✱ test_spectrum_integrated__-1-downbranch__.npy
│ │ │ │ ✱ test_spectrum_integrated__-1-macroatom__.npy
│ │ │ │ ✱ test_spectrum_integrated__30-downbranch__.npy
│ │ │ │ ✱ test_spectrum_integrated__30-macroatom__.npy
│ ā”œ transport/
│ │ ā”œ montecarlo/
│ │ │ ā”œ tests/
│ │ │ │ ā”œ test_continuum/
│ │ │ │ ā”œ test_montecarlo_main_loop/
│ │ │ │ │ ✱ test_montecarlo_main_loop.h5
│ │ │ │ │ ✱ test_montecarlo_main_loop_vpacket_log.h5
│ │ │ │ ā”œ test_packet_source/
│ │ │ │ │ ā”œ test_black_body_simple_source/
│ │ │ │ │ │ ✱ test_bb_attributes.h5
│ │ │ │ │ ā”œ test_black_body_simple_source_rel/
│ │ │ │ │ │ ✱ test_bb_attributes.h5
│ │ │ │ ā”œ test_rpacket_tracker/
│ │ │ │ ā”œ test_weighted_packet_source/
│ │ │ │ │ ā”œ test_black_body_weighted_source/
│ │ │ │ │ │ ✱ test_bb_attributes.h5
│ ā”œ visualization/
│ │ ā”œ tools/
│ │ │ ā”œ tests/
│ │ │ │ ā”œ test_liv_plot/
│ │ │ │ │ ā”œ test_liv_plotter/
│ │ │ │ │ │ ✱ test_generate_plot_mpl__plotter_generate_plot_mpl0__.h5
│ │ │ │ │ │ ✱ test_generate_plot_mpl__plotter_generate_plot_mpl1__.h5
│ │ │ │ │ │ ✱ test_generate_plot_mpl__plotter_generate_plot_mpl2__.h5
│ │ │ │ │ │ ✱ test_generate_plot_mpl__plotter_generate_plot_mpl3__.h5
│ │ │ │ │ │ ✱ test_generate_plot_mpl__plotter_generate_plot_mpl4__.h5
│ │ │ │ │ │ ✱ test_generate_plot_mpl__plotter_generate_plot_mpl5__.h5
│ │ │ │ │ │ ✱ test_generate_plot_mpl__plotter_generate_plot_mpl6__.h5
│ │ │ │ │ │ ✱ test_generate_plot_mpl__plotter_generate_plot_mpl7__.h5
│ │ │ │ │ │ ✱ test_generate_plot_ply__plotter_generate_plot_ply0__.h5
│ │ │ │ │ │ ✱ test_generate_plot_ply__plotter_generate_plot_ply1__.h5
│ │ │ │ │ │ ✱ test_generate_plot_ply__plotter_generate_plot_ply2__.h5
│ │ │ │ │ │ ✱ test_generate_plot_ply__plotter_generate_plot_ply3__.h5
│ │ │ │ │ │ ✱ test_generate_plot_ply__plotter_generate_plot_ply4__.h5
│ │ │ │ │ │ ✱ test_generate_plot_ply__plotter_generate_plot_ply5__.h5
│ │ │ │ │ │ ✱ test_generate_plot_ply__plotter_generate_plot_ply6__.h5
│ │ │ │ │ │ ✱ test_generate_plot_ply__plotter_generate_plot_ply7__.h5
│ │ │ │ ā”œ test_sdec_plot/
│ │ │ │ │ ā”œ test_sdec_plotter/
│ │ │ │ │ │ ✱ test_calculate_plotting_data__plotter_calculate_plotting_data0__.h5
│ │ │ │ │ │ ✱ test_calculate_plotting_data__plotter_calculate_plotting_data10__.h5
│ │ │ │ │ │ ✱ test_calculate_plotting_data__plotter_calculate_plotting_data11__.h5
│ │ │ │ │ │ ✱ test_calculate_plotting_data__plotter_calculate_plotting_data12__.h5
│ │ │ │ │ │ ✱ test_calculate_plotting_data__plotter_calculate_plotting_data13__.h5
│ │ │ │ │ │ ✱ test_calculate_plotting_data__plotter_calculate_plotting_data14__.h5
│ │ │ │ │ │ ✱ test_calculate_plotting_data__plotter_calculate_plotting_data15__.h5
│ │ │ │ │ │ ✱ test_calculate_plotting_data__plotter_calculate_plotting_data1__.h5
│ │ │ │ │ │ ✱ test_calculate_plotting_data__plotter_calculate_plotting_data2__.h5
│ │ │ │ │ │ ✱ test_calculate_plotting_data__plotter_calculate_plotting_data3__.h5
│ │ │ │ │ │ ✱ test_calculate_plotting_data__plotter_calculate_plotting_data4__.h5
│ │ │ │ │ │ ✱ test_calculate_plotting_data__plotter_calculate_plotting_data5__.h5
│ │ │ │ │ │ ✱ test_calculate_plotting_data__plotter_calculate_plotting_data6__.h5
│ │ │ │ │ │ ✱ test_calculate_plotting_data__plotter_calculate_plotting_data7__.h5
│ │ │ │ │ │ ✱ test_calculate_plotting_data__plotter_calculate_plotting_data8__.h5
│ │ │ │ │ │ ✱ test_calculate_plotting_data__plotter_calculate_plotting_data9__.h5
│ │ │ │ │ │ ✱ test_generate_plot_mpl__plotter_generate_plot_ply0__.h5
│ │ │ │ │ │ ✱ test_generate_plot_mpl__plotter_generate_plot_ply10__.h5
│ │ │ │ │ │ ✱ test_generate_plot_mpl__plotter_generate_plot_ply11__.h5
│ │ │ │ │ │ ✱ test_generate_plot_mpl__plotter_generate_plot_ply12__.h5
│ │ │ │ │ │ ✱ test_generate_plot_mpl__plotter_generate_plot_ply13__.h5
│ │ │ │ │ │ ✱ test_generate_plot_mpl__plotter_generate_plot_ply14__.h5
│ │ │ │ │ │ ✱ test_generate_plot_mpl__plotter_generate_plot_ply15__.h5
│ │ │ │ │ │ ✱ test_generate_plot_mpl__plotter_generate_plot_ply1__.h5
│ │ │ │ │ │ ✱ test_generate_plot_mpl__plotter_generate_plot_ply2__.h5
│ │ │ │ │ │ ✱ test_generate_plot_mpl__plotter_generate_plot_ply3__.h5
│ │ │ │ │ │ ✱ test_generate_plot_mpl__plotter_generate_plot_ply4__.h5
│ │ │ │ │ │ ✱ test_generate_plot_mpl__plotter_generate_plot_ply5__.h5
│ │ │ │ │ │ ✱ test_generate_plot_mpl__plotter_generate_plot_ply6__.h5
│ │ │ │ │ │ ✱ test_generate_plot_mpl__plotter_generate_plot_ply7__.h5
│ │ │ │ │ │ ✱ test_generate_plot_mpl__plotter_generate_plot_ply8__.h5
│ │ │ │ │ │ ✱ test_generate_plot_mpl__plotter_generate_plot_ply9__.h5
InĀ [6]:
comparer.compare()
Displaying heatmap for key /simulation/spectrum_solver/spectrum_integrated/luminosity_density_lambda in file TestTransportSimple.h5 
Visualising Absolute Differences
Ā  0
mean 1e+32
max 2e+32
Visualising Relative Differences
Ā  0
mean 4.1e-16
max 7.9e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/tests/test_tardis_full/test_transport_simple
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/tests/test_tardis_full/test_transport_simple
Displaying heatmap for key /simulation/spectrum_solver/spectrum_integrated/luminosity in file TestTransportSimple.h5 
Visualising Absolute Differences
Ā  0
mean 1.9e+24
max 3.6e+24
Visualising Relative Differences
Ā  0
mean 3.7e-16
max 7.1e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/tests/test_tardis_full/test_transport_simple
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/tests/test_tardis_full/test_transport_simple
Error comparing item: /simulation/plasma/dilute_planckian_radiation_field
No module named 'tardis.plasma.radiation_field'
==================================================
Summary for TestTransportSimple.h5:
Total number of keys- in ref1: 93, in ref2: 93
Number of keys with different names in ref1 and ref2: 0
Number of keys with same name but different data in ref1 and ref2: 2
Number of totally same keys: 90
==================================================

Displaying heatmap for key /simulation_container/spectrum_solver/spectrum_integrated/luminosity in file test_simulation__-1-macroatom__.h5 
Visualising Absolute Differences
Ā  0
mean 1.9e+24
max 3.6e+24
Visualising Relative Differences
Ā  0
mean 3.5e-16
max 6.6e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral
Displaying heatmap for key /simulation_container/spectrum_solver/spectrum_integrated/luminosity_density_lambda in file test_simulation__-1-macroatom__.h5 
Visualising Absolute Differences
Ā  0
mean 1.2e+32
max 2.4e+32
Visualising Relative Differences
Ā  0
mean 3.9e-16
max 7.4e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral

==================================================
Summary for test_simulation__-1-macroatom__.h5:
Total number of keys- in ref1: 24, in ref2: 24
Number of keys with different names in ref1 and ref2: 0
Number of keys with same name but different data in ref1 and ref2: 2
Number of totally same keys: 22
==================================================

Displaying heatmap for key /simulation_container/spectrum_solver/spectrum_integrated/luminosity in file test_simulation__-1-downbranch__.h5 
Visualising Absolute Differences
Ā  0
mean 1.6e+24
max 3e+24
Visualising Relative Differences
Ā  0
mean 3.4e-16
max 6.5e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral
Displaying heatmap for key /simulation_container/spectrum_solver/spectrum_integrated/luminosity_density_lambda in file test_simulation__-1-downbranch__.h5 
Visualising Absolute Differences
Ā  0
mean 1.2e+32
max 2.4e+32
Visualising Relative Differences
Ā  0
mean 4.3e-16
max 8.3e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral
==================================================
Summary for test_simulation__-1-downbranch__.h5:
Total number of keys- in ref1: 24, in ref2: 24
Number of keys with different names in ref1 and ref2: 0
Number of keys with same name but different data in ref1 and ref2: 2
Number of totally same keys: 22
==================================================

Displaying heatmap for key /simulation_container/spectrum_solver/spectrum_integrated/luminosity in file test_simulation__30-macroatom__.h5 
Visualising Absolute Differences
Ā  0
mean 1.9e+24
max 3.6e+24
Visualising Relative Differences
Ā  0
mean 3.7e-16
max 7e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral
Displaying heatmap for key /simulation_container/spectrum_solver/spectrum_integrated/luminosity_density_lambda in file test_simulation__30-macroatom__.h5 
Visualising Absolute Differences
Ā  0
mean 1.2e+32
max 2.4e+32
Visualising Relative Differences
Ā  0
mean 4.6e-16
max 8.7e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral
==================================================
Summary for test_simulation__30-macroatom__.h5:
Total number of keys- in ref1: 24, in ref2: 24
Number of keys with different names in ref1 and ref2: 0
Number of keys with same name but different data in ref1 and ref2: 2
Number of totally same keys: 22
==================================================

Displaying heatmap for key /simulation_container/spectrum_solver/spectrum_integrated/luminosity in file test_simulation__30-downbranch__.h5 
Visualising Absolute Differences
Ā  0
mean 1.9e+24
max 3.6e+24
Visualising Relative Differences
Ā  0
mean 3.9e-16
max 7.4e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral
Displaying heatmap for key /simulation_container/spectrum_solver/spectrum_integrated/luminosity_density_lambda in file test_simulation__30-downbranch__.h5 
Visualising Absolute Differences
Ā  0
mean 1.2e+32
max 2.4e+32
Visualising Relative Differences
Ā  0
mean 4.6e-16
max 8.7e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral
==================================================
Summary for test_simulation__30-downbranch__.h5:
Total number of keys- in ref1: 24, in ref2: 24
Number of keys with different names in ref1 and ref2: 0
Number of keys with same name but different data in ref1 and ref2: 2
Number of totally same keys: 22
==================================================

Displaying heatmap for key /simulation/spectrum_solver/spectrum_integrated/luminosity_density_lambda in file TestSpectrumSolver.h5 
Visualising Absolute Differences
Ā  0
mean 6.2e+31
max 1.2e+32
Visualising Relative Differences
Ā  0
mean 4.1e-16
max 7.9e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/spectrum/tests/test_spectrum_solver/test_spectrum_solver
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/spectrum/tests/test_spectrum_solver/test_spectrum_solver
Displaying heatmap for key /simulation/spectrum_solver/spectrum_integrated/luminosity in file TestSpectrumSolver.h5 
Visualising Absolute Differences
Ā  0
mean 1.9e+24
max 3.6e+24
Visualising Relative Differences
Ā  0
mean 4.2e-16
max 7.9e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/spectrum/tests/test_spectrum_solver/test_spectrum_solver
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/spectrum/tests/test_spectrum_solver/test_spectrum_solver
Error comparing item: /simulation/plasma/dilute_planckian_radiation_field
No module named 'tardis.plasma.radiation_field'
==================================================
Summary for TestSpectrumSolver.h5:
Total number of keys- in ref1: 93, in ref2: 93
Number of keys with different names in ref1 and ref2: 0
Number of keys with same name but different data in ref1 and ref2: 2
Number of totally same keys: 90
==================================================

Error comparing item: /plasma/dilute_planckian_radiation_field
No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field
No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field
No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field
No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field
No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field
No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field
No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field
No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field
No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field
No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field
No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field
No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field
No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field
No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field
No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field
No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field
No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field
No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field
No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field
No module named 'tardis.plasma.radiation_field'
Error comparing item: /simulation/plasma/dilute_planckian_radiation_field
No module named 'tardis.plasma.radiation_field'
Error comparing item: /simulation/plasma/yg_interp
unsupported operand type(s) for -: 'PchipInterpolator' and 'PchipInterpolator'

==================================================
Summary for test_montecarlo_continuum.h5:
Total number of keys- in ref1: 148, in ref2: 148
Number of keys with different names in ref1 and ref2: 0
Number of keys with same name but different data in ref1 and ref2: 1
Number of totally same keys: 146
==================================================

Displaying heatmap for key /simulation/spectrum_solver/spectrum_integrated/luminosity_density_lambda in file test_montecarlo_main_loop_vpacket_log.h5 
Visualising Absolute Differences
Ā  0
mean 6.3e+31
max 1.2e+32
Visualising Relative Differences
Ā  0
mean 4.1e-16
max 7.8e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/transport/montecarlo/tests/test_montecarlo_main_loop
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/transport/montecarlo/tests/test_montecarlo_main_loop
Displaying heatmap for key /simulation/spectrum_solver/spectrum_integrated/luminosity in file test_montecarlo_main_loop_vpacket_log.h5 
Visualising Absolute Differences
Ā  0
mean 1.6e+24
max 3e+24
Visualising Relative Differences
Ā  0
mean 3.6e-16
max 6.8e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/transport/montecarlo/tests/test_montecarlo_main_loop
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/transport/montecarlo/tests/test_montecarlo_main_loop
Error comparing item: /simulation/plasma/dilute_planckian_radiation_field
No module named 'tardis.plasma.radiation_field'
==================================================
Summary for test_montecarlo_main_loop_vpacket_log.h5:
Total number of keys- in ref1: 93, in ref2: 93
Number of keys with different names in ref1 and ref2: 0
Number of keys with same name but different data in ref1 and ref2: 2
Number of totally same keys: 90
==================================================

Displaying heatmap for key /simulation/spectrum_solver/spectrum_integrated/luminosity_density_lambda in file test_montecarlo_main_loop.h5 
Visualising Absolute Differences
Ā  0
mean 6.3e+31
max 1.2e+32
Visualising Relative Differences
Ā  0
mean 4.2e-16
max 8.1e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/transport/montecarlo/tests/test_montecarlo_main_loop
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/transport/montecarlo/tests/test_montecarlo_main_loop
Displaying heatmap for key /simulation/spectrum_solver/spectrum_integrated/luminosity in file test_montecarlo_main_loop.h5 
Visualising Absolute Differences
Ā  0
mean 1.2e+24
max 2.4e+24
Visualising Relative Differences
Ā  0
mean 3.9e-16
max 7.4e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/transport/montecarlo/tests/test_montecarlo_main_loop
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/transport/montecarlo/tests/test_montecarlo_main_loop
Error comparing item: /simulation/plasma/dilute_planckian_radiation_field
No module named 'tardis.plasma.radiation_field'

==================================================
Summary for test_montecarlo_main_loop.h5:
Total number of keys- in ref1: 83, in ref2: 83
Number of keys with different names in ref1 and ref2: 0
Number of keys with same name but different data in ref1 and ref2: 2
Number of totally same keys: 80
==================================================

Displaying heatmap for key /plot_data_hdf/_10y in file test_generate_plot_mpl__plotter_generate_plot_ply0__.h5 
Visualising Absolute Differences
Ā  0
mean 2e-31
max 3.9e-31
Visualising Relative Differences
Ā  0
mean 5.9e-17
max 1.2e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter

==================================================
Summary for test_generate_plot_mpl__plotter_generate_plot_ply0__.h5:
Total number of keys- in ref1: 27, in ref2: 27
Number of keys with different names in ref1 and ref2: 0
Number of keys with same name but different data in ref1 and ref2: 1
Number of totally same keys: 26
==================================================

Displaying heatmap for key /plot_data_hdf/_10y in file test_generate_plot_mpl__plotter_generate_plot_ply4__.h5 
Visualising Absolute Differences
Ā  0
mean 2e-31
max 3.9e-31
Visualising Relative Differences
Ā  0
mean 5.9e-17
max 1.2e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter

==================================================
Summary for test_generate_plot_mpl__plotter_generate_plot_ply4__.h5:
Total number of keys- in ref1: 27, in ref2: 27
Number of keys with different names in ref1 and ref2: 0
Number of keys with same name but different data in ref1 and ref2: 1
Number of totally same keys: 26
==================================================

Displaying heatmap for key /plot_data_hdf/_9y in file test_generate_plot_mpl__plotter_generate_plot_ply5__.h5 
Visualising Absolute Differences
Ā  0
mean 2e-31
max 3.9e-31
Visualising Relative Differences
Ā  0
mean 5.9e-17
max 1.2e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter

==================================================
Summary for test_generate_plot_mpl__plotter_generate_plot_ply5__.h5:
Total number of keys- in ref1: 25, in ref2: 25
Number of keys with different names in ref1 and ref2: 0
Number of keys with same name but different data in ref1 and ref2: 1
Number of totally same keys: 24
==================================================

Displaying heatmap for key /plot_data_hdf/_9y in file test_generate_plot_mpl__plotter_generate_plot_ply10__.h5 
Visualising Absolute Differences
Ā  0
mean 2.4e+21
max 4.7e+21
Visualising Relative Differences
Ā  0
mean 5.9e-17
max 1.2e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter

==================================================
Summary for test_generate_plot_mpl__plotter_generate_plot_ply10__.h5:
Total number of keys- in ref1: 25, in ref2: 25
Number of keys with different names in ref1 and ref2: 0
Number of keys with same name but different data in ref1 and ref2: 1
Number of totally same keys: 24
==================================================

Displaying heatmap for key /plot_data_hdf/_9y in file test_generate_plot_mpl__plotter_generate_plot_ply14__.h5 
Visualising Absolute Differences
Ā  0
mean 2.4e+21
max 4.7e+21
Visualising Relative Differences
Ā  0
mean 5.9e-17
max 1.2e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter
==================================================
Summary for test_generate_plot_mpl__plotter_generate_plot_ply14__.h5:
Total number of keys- in ref1: 25, in ref2: 25
Number of keys with different names in ref1 and ref2: 0
Number of keys with same name but different data in ref1 and ref2: 1
Number of totally same keys: 24
==================================================

Displaying heatmap for key /plot_data_hdf/_9y in file test_generate_plot_mpl__plotter_generate_plot_ply7__.h5 
Visualising Absolute Differences
Ā  0
mean 2e-31
max 3.9e-31
Visualising Relative Differences
Ā  0
mean 5.9e-17
max 1.2e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter
==================================================
Summary for test_generate_plot_mpl__plotter_generate_plot_ply7__.h5:
Total number of keys- in ref1: 25, in ref2: 25
Number of keys with different names in ref1 and ref2: 0
Number of keys with same name but different data in ref1 and ref2: 1
Number of totally same keys: 24
==================================================

Displaying heatmap for key /plot_data_hdf/_10y in file test_generate_plot_mpl__plotter_generate_plot_ply2__.h5 
Visualising Absolute Differences
Ā  0
mean 2e-31
max 3.9e-31
Visualising Relative Differences
Ā  0
mean 5.9e-17
max 1.2e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter

==================================================
Summary for test_generate_plot_mpl__plotter_generate_plot_ply2__.h5:
Total number of keys- in ref1: 27, in ref2: 27
Number of keys with different names in ref1 and ref2: 0
Number of keys with same name but different data in ref1 and ref2: 1
Number of totally same keys: 26
==================================================

Displaying heatmap for key /plot_data_hdf/_8y in file test_generate_plot_mpl__plotter_generate_plot_ply11__.h5 
Visualising Absolute Differences
Ā  0
mean 2.4e+21
max 4.7e+21
Visualising Relative Differences
Ā  0
mean 5.9e-17
max 1.2e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter

==================================================
Summary for test_generate_plot_mpl__plotter_generate_plot_ply11__.h5:
Total number of keys- in ref1: 23, in ref2: 23
Number of keys with different names in ref1 and ref2: 0
Number of keys with same name but different data in ref1 and ref2: 1
Number of totally same keys: 22
==================================================

Displaying heatmap for key /plot_data_hdf/_9y in file test_generate_plot_mpl__plotter_generate_plot_ply3__.h5 
Visualising Absolute Differences
Ā  0
mean 2e-31
max 3.9e-31
Visualising Relative Differences
Ā  0
mean 5.9e-17
max 1.2e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter

==================================================
Summary for test_generate_plot_mpl__plotter_generate_plot_ply3__.h5:
Total number of keys- in ref1: 25, in ref2: 25
Number of keys with different names in ref1 and ref2: 0
Number of keys with same name but different data in ref1 and ref2: 1
Number of totally same keys: 24
==================================================

Displaying heatmap for key /plot_data_hdf/_8y in file test_generate_plot_mpl__plotter_generate_plot_ply13__.h5 
Visualising Absolute Differences
Ā  0
mean 2.4e+21
max 4.7e+21
Visualising Relative Differences
Ā  0
mean 5.9e-17
max 1.2e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter

==================================================
Summary for test_generate_plot_mpl__plotter_generate_plot_ply13__.h5:
Total number of keys- in ref1: 23, in ref2: 23
Number of keys with different names in ref1 and ref2: 0
Number of keys with same name but different data in ref1 and ref2: 1
Number of totally same keys: 22
==================================================

Displaying heatmap for key /plot_data_hdf/_9y in file test_generate_plot_mpl__plotter_generate_plot_ply1__.h5 
Visualising Absolute Differences
Ā  0
mean 2e-31
max 3.9e-31
Visualising Relative Differences
Ā  0
mean 5.9e-17
max 1.2e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter

==================================================
Summary for test_generate_plot_mpl__plotter_generate_plot_ply1__.h5:
Total number of keys- in ref1: 25, in ref2: 25
Number of keys with different names in ref1 and ref2: 0
Number of keys with same name but different data in ref1 and ref2: 1
Number of totally same keys: 24
==================================================

Displaying heatmap for key /plot_data_hdf/_9y in file test_generate_plot_mpl__plotter_generate_plot_ply8__.h5 
Visualising Absolute Differences
Ā  0
mean 2.4e+21
max 4.7e+21
Visualising Relative Differences
Ā  0
mean 5.9e-17
max 1.2e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter

==================================================
Summary for test_generate_plot_mpl__plotter_generate_plot_ply8__.h5:
Total number of keys- in ref1: 25, in ref2: 25
Number of keys with different names in ref1 and ref2: 0
Number of keys with same name but different data in ref1 and ref2: 1
Number of totally same keys: 24
==================================================

Displaying heatmap for key /plot_data_hdf/_8y in file test_generate_plot_mpl__plotter_generate_plot_ply9__.h5 
Visualising Absolute Differences
Ā  0
mean 2.4e+21
max 4.7e+21
Visualising Relative Differences
Ā  0
mean 5.9e-17
max 1.2e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter

==================================================
Summary for test_generate_plot_mpl__plotter_generate_plot_ply9__.h5:
Total number of keys- in ref1: 23, in ref2: 23
Number of keys with different names in ref1 and ref2: 0
Number of keys with same name but different data in ref1 and ref2: 1
Number of totally same keys: 22
==================================================

Displaying heatmap for key /plot_data_hdf/_8y in file test_generate_plot_mpl__plotter_generate_plot_ply15__.h5 
Visualising Absolute Differences
Ā  0
mean 2.4e+21
max 4.7e+21
Visualising Relative Differences
Ā  0
mean 5.9e-17
max 1.2e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter

==================================================
Summary for test_generate_plot_mpl__plotter_generate_plot_ply15__.h5:
Total number of keys- in ref1: 23, in ref2: 23
Number of keys with different names in ref1 and ref2: 0
Number of keys with same name but different data in ref1 and ref2: 1
Number of totally same keys: 22
==================================================

Displaying heatmap for key /plot_data_hdf/_10y in file test_generate_plot_mpl__plotter_generate_plot_ply6__.h5 
Visualising Absolute Differences
Ā  0
mean 2e-31
max 3.9e-31
Visualising Relative Differences
Ā  0
mean 5.9e-17
max 1.2e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter

==================================================
Summary for test_generate_plot_mpl__plotter_generate_plot_ply6__.h5:
Total number of keys- in ref1: 27, in ref2: 27
Number of keys with different names in ref1 and ref2: 0
Number of keys with same name but different data in ref1 and ref2: 1
Number of totally same keys: 26
==================================================

Displaying heatmap for key /plot_data_hdf/_9y in file test_generate_plot_mpl__plotter_generate_plot_ply12__.h5 
Visualising Absolute Differences
Ā  0
mean 2.4e+21
max 4.7e+21
Visualising Relative Differences
Ā  0
mean 5.9e-17
max 1.2e-16
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter
Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter

==================================================
Summary for test_generate_plot_mpl__plotter_generate_plot_ply12__.h5:
Total number of keys- in ref1: 25, in ref2: 25
Number of keys with different names in ref1 and ref2: 0
Number of keys with same name but different data in ref1 and ref2: 1
Number of totally same keys: 24
==================================================

Testing individual files¶

You can compare individual files too. Below example would work if you used example commits.

InĀ [7]:
# comparer.hdf_comparator.summarise_changes_hdf("test_generate_plot_ply__plotter_generate_plot_ply1__.h5",
#                                              Path(comparer.ref1_path) / "tardis/visualization/tools/tests/test_liv_plot/test_liv_plotter",
#                                              Path(comparer.ref2_path) / "tardis/visualization/tools/tests/test_liv_plot/test_liv_plotter"
#                                              )

HDF File Comparison¶

Below graph visualises all the HDF files that changed. Each block represents a key that changed, hovering on that block would show relative percentage change for that key.

InĀ [8]:
fig_same_name = comparer.generate_graph("different keys same name")
fig_different_keys = comparer.generate_graph("different keys")
Generating graph with updated hovertemplate
Saved plot to comparison_plots_c31d35_new_b2fdf4_old/same_name_diff.png
Generating graph with updated hovertemplate
InĀ [9]:
fig_different_keys
InĀ [10]:
fig_same_name.layout.width = 1000
fig_same_name

Spectrum Comparison¶

You can compare TARDIS spectra for the two commits and also provide a custom path for the spectra.

InĀ [11]:
comparer.compare_testspectrumsolver_hdf(
    custom_ref1_path=Path(comparer.ref1_path) / custom_ref1_spectrum_path, 
    custom_ref2_path=Path(comparer.ref2_path) / custom_ref2_spectrum_path
)
/home/runner/work/tardis/tardis/tardis-regression-data/compare.py:332: UserWarning:

This figure includes Axes that are not compatible with tight_layout, so results might be incorrect.

Saved spectrum plot to comparison_plots_c31d35_new_b2fdf4_old/spectrum.png
No description has been provided for this image
InĀ [12]:
comparer.teardown()
Removed temporary directory /tmp/ref_compare_lfl0odub